package io.renren.modules.app.controller;

import io.renren.common.utils.R;
import io.renren.modules.app.service.ApiBannerService;
import io.renren.modules.sys.entity.BannerEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * banner
 * @author wangyi
 * @mail 794651397@qq.com
 * @createdate 2018/3/15 17:16
 **/
@Api(description = "banner轮播")
@RestController
@RequestMapping("/app")
public class ApiBannerController {
    @Autowired
    private ApiBannerService apiBannerService;
    
    /**
     * 获取banner
     * @author wangyi
     * @createdate 2018/3/15 17:17
     **/
    @ApiOperation("获取banner")
     @PostMapping("banner")
     public R banner(){
         HashMap<String,Object> map=new HashMap<>();
         map.put("status",1);
         List<BannerEntity> bannerList = apiBannerService.queryList(map);
        return R.ok().put("result",bannerList);
     }
}
